import request from '@/axios'

export const getDictPageListApi = (data) => {
  return request.post({ url: '/api/dict/pageList', data })
}

export const saveDict = (data) => {
  return request.post({ url: '/api/dict/saveDict', data })
}

export const updateDict = (data) => {
  return request.post({ url: '/api/dict/updateDict', data })
}

export const delDict = (dictId: string) => {
  return request.post({ url: '/api/dict/delDict', data: { id: dictId } })
}

export const batchDelDict = (ids: string[] | number[]) => {
  return request.post({ url: '/api/dict/batchDelDict', data: { ids } })
}

export const saveDictItem = (data) => {
  return request.post({ url: '/api/dict/saveDictItem', data })
}

export const delDictItem = (data) => {
  return request.post({ url: '/api/dict/delDictItem', data })
}

export const updateDictItem = (data) => {
  return request.post({ url: '/api/dict/updateDictItem', data })
}

export const itemPageList = (data) => {
  return request.post({ url: '/api/dict/itemPageList', data })
}

export const optionsListApi = (data) => {
  return request.post({ url: '/api/dict/optionsList', data })
}

export const getDictItemByCodeApi = (data) => {
  return request.post({ url: '/api/dict/getDictItemByCode', data })
}
